package com.example.demo.service;

public class Demo {
    public static String getStr(String[] source){
        StringBuffer sb = new StringBuffer();
        for (int i = 0 ;i<source.length;i++){
            sb.append(source[i]);
            sb.append(",");
        }

        return sb.substring(0,sb.lastIndexOf(","));
    }

    public static void main(String[] args) {
        String source[] = {"AA","BB","CC"};
        String result = getStr(source);
        System.out.println(result);
    }
}
